package com.ruoyi.common.enums;

/**
 * 大写的1,2,3,4
 *
 */
public enum UppercaseNumber
{
    ONE(1,"一"),

    TWO(2,"二"),

    THREE(3,"三"),

    FOUR(4,"四"),

    FIVE(5,"五"),

    SIX(6,"六"),

    SEVEN(7,"七"),

    EIGHT(8,"八"),

    NINE(9,"九"),

    TEN(10,"十");

    private int code;
    private String desc;

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDescByCode(int code) {
        UppercaseNumber[] uppercaseNumbers = UppercaseNumber.values();

        for (UppercaseNumber uppercaseNumber:uppercaseNumbers) {
            if (uppercaseNumber.getCode() == code) {
                return uppercaseNumber.getDesc();
            }
        }

        return null;
    }

    UppercaseNumber(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}
